<style>
    #server{
        border:1px solid #ccc;
        width:598px;
        background:#fff;
       
        float:left;
        
    }
    .info_server{
        width: 500px;    
        padding:5px;
        margin:10px auto;           
        float:left;
        
    }
    .info_server h1{
        font-size:14px;
        text-align:center;  
        
    }
    .info_server ul{
        width: 400px;
        
    }
    .info_server table{
        font-size:12px;
         
    }
    .info_server .css_a{
    background-color: red;
    border: 1px solid #B0AFAF;
    color: #fff;
    margin-top:5px;
    line-height:25px;
    padding: 5px 20px;    
    }
   
    li{
        font-weight: bold;
    }
    label.error{
        color:red;
      font-weight:bold;
    }
</style>
<script>
    $().ready(function(){
        $('#send_form').validate({
            rules:{
                txt_user : {required:true},
                txt_address : {required:true},
                txt_phone : {required:true, number: true},
                txt_email : {required:true, email: true},
                captcha_code : {required:true}
            },
             messages : {
                txt_user : {
                    required : "Bạn nhập họ tên"
                },
                txt_address : {
                    required : "Bạn nhập địa chỉ",
                },
                txt_phone : {
                    required : "Bạn nhập phone",
                    number : "Bạn nhập phone phải là số",
                },
                txt_email : {
                    required : "Bạn nhập email",
                    email : "Bạn nhập email chưa đúng",
                },
                captcha_code : {
                    required : "Bạn nhập capcha",
                }
            },
            submitHandler: function(form) {
                var name = $('#txt_user').val();
                var address = $('#txt_address').val();
                var phone = $('#txt_phone').val();
                var email = $('#txt_email').val();
                var comment = $('#txt_content').val();
                var capcha_code = $('#captcha_code').val();
                var dataString = 'email='+email +'&name='+name+'&address='+address+'&phone='+phone+'&comment='+comment+'&capcha_code='+capcha_code;
               $('.load').html('<img src="<?php echo base_url()?>public/images/loading.gif" />');          
               $.ajax({
                type : "GET",
                dataType : "json",
                url : "<?php echo base_url().'butbi/server/send_email'?>",
                data : dataString,
                success : function(result){
                    $('.load').html('');                      
                    $('#captcha_code').val(''); 
                    alert(result.status);
                    return false;
                } 
               });
            },
            
        });
        
    });
</script>


<style>

p {
    color: #686868;
    line-height: 1.4em;
    margin: 0;
    padding: 0.4em 0;
    padding:5px;
}
</style>
<div class="center_column" id="center_column">


<!-- tmbannerblock2 -->

<div class="clearblock"></div>
<!-- /tmbannerblock2 -->
<!-- MODULE Home Featured Products -->
<div id="featured_products">
	<h4>LIÊN HỆ</h4>
		<div class="block_content">
        <div class="info_server">
        <h1>CÔNG TY TNHH ĐẠI ĐỒNG HÀNH</h1>
        <ul>
            <li><img src="<?php echo base_url()?>public/butbi/images/center_l.gif" /> Địa chỉ : <?php echo $setting->address_tv;?> </li>
             <li><img src="<?php echo base_url()?>public/butbi/images/center_l.gif" /> Điện thoại : <?php echo $setting->phone;?></li>
              <li><img src="<?php echo base_url()?>public/butbi/images/center_l.gif" /> Email : <?php echo $setting->email_company;?></li>
               <li><img src="<?php echo base_url()?>public/butbi/images/center_l.gif" /> Website : <a href="<?php echo $setting->website;?>"> <?php echo $setting->website;?></a></li>
        </ul>
        </div>
        <div class="info_server">
<style>
    input{
        margin:5px;
    }
</style>    
        <h1>CÔNG TY TNHH ĐẠI ĐỒNG HÀNH</h1>
        <div class="jerror">
            <ul>
                <li></li>                
            </ul>            
        </div>
        <form action="" method="POST" id="send_form">       
        <table style="width: 600px; float:left; padding:5px; margin:5px">
            <tr>
                <td>Tên bạn:</td>
                <td><input type="text" value="" name="txt_user" id="txt_user" size="20" placeholder="Tên bạn (*)"/></td>
            </tr>
            <tr>
                <td>Địa chỉ:</td>
                <td><input type="text" value="" name="txt_address" id="txt_address" size="20" placeholder="Địa chỉ (*)"/></td>
            </tr>
            <tr>
                <td>Điện thoại</td>
                <td><input type="text" value="" name="txt_phone" id="txt_phone" size="20" placeholder="Điện thoại (*)"/></td>
            </tr>
            <tr>
                <td>Email:</td>
                <td><input type="text" value="" name="txt_email" id="txt_email" size="20" placeholder="Email (*)"/></td>
            </tr>
            <tr>
                <td>Nội dung:</td>
                <td><textarea style="width: 400px;" placeholder="Nội dung (*)" name="txt_content" id="txt_content" cols="35" rows="9"></textarea></td>
            </tr>
            <tr>             
                <td></td>
                <td>
                    <img style="vertical-align: bottom;" id="captcha" src="<?php echo base_url(); ?>public/securimage/securimage_show.php" alt="CAPTCHA Image" />

                </td>
            </tr>
            <tr>
                <td></td>
                <td><a href="#" id="dif_image_command" onclick="document.getElementById('captcha').src = '<?php echo base_url(); ?>public/securimage/securimage_show.php?' + Math.random(); return false">[ Different Image ]</a>
               </td>
            </tr>
            <tr>
                <td>Capcha</td>
                <td><input type="text" placeholder="Capcha (*)" name="captcha_code" id="captcha_code" size="20" maxlength="6" /></td>
            </tr>
            <tr>
                <td></td>
                <td><a href="javascript:void(0)" onclick="$('#send_form').submit()" id="send" class="css_a">Gửi</a></td>
            </tr>
        </table>
        </form>
    </div>
		
	</div>
	</div>
<!-- /MODULE Home Featured Products -->		</div>

